<!--
 * @Author: haoshenpei
 * @Date: 2025-02-24 16:27:39
 * @LastEditors: hyman
 * @LastEditTime: 2025-02-26 14:02:32
 * @Description: 请填写简介
-->
<template>
    <div>
        <div style="font-size:32px; color:#3f0;">页面a</div>
        <a-button @click="showModal">新增</a-button>
        <a-button @click="clearF">清空</a-button>
       <!--  <input v-for="(item,i) in 1000" v-model="aa" :key="i"  :class="'aa'+i" /> -->
        <!-- <component v-for="(formitem) in properties"
        :key="formitem.field"
        :is="formitem.type"
        
        :formModel="model" :field="formitem.field" :type="formitem.type"></component> -->
        <myModal :list="properties" ref="modal" :model="model" @change="changeF" /> <!-- @change="changeF"  -->
        <!-- <a-form-model ref="formRef" :preserve-form="false">
            <list :list="list" :model="model" @change="changeF" />
        </a-form-model> -->
    </div>
</template>

<script>
//import inputWiget from './inputWiget.vue';
//import selectWiget from './selectWiget.vue';
//import textareaWiget from './textareaWiget.vue';
    import myModal from './myModal.vue';
    //import list from './list'
    export default {
        components:{
            myModal//,list,inputWiget,selectWiget,textareaWiget
        },
        data(){
            return {
                aa:'',
                properties:[
                    {type:'inputWiget',field:'name1'},
                    {type:'selectWiget',field:'name2'},
                    {type:'textareaWiget',field:'name3'},
                    {type:'inputWiget',field:'name21'},
                    {type:'selectWiget',field:'name32'},
                    {type:'textareaWiget',field:'name43'},
                    {type:'inputWiget',field:'name51'},
                    {type:'selectWiget',field:'name62'},
                    {type:'textareaWiget',field:'name73'},
                    {type:'inputWiget',field:'name81'},
                    {type:'selectWiget',field:'name82'},
                    {type:'textareaWiget',field:'name83'},
                    {type:'inputWiget',field:'name91'},
                    {type:'selectWiget',field:'name92'},
                    {type:'textareaWiget',field:'name93'},
                    {type:'inputWiget',field:'name101'},
                    {type:'selectWiget',field:'name102'},
                    {type:'textareaWiget',field:'name103'},
                ],
               model:{
                name1:'',
                name2:'',
                name3:'',
                name4:'',
                name5:'',
                name6:'',
               }
            }
        },
        beforeDestroy(){
            console.log('a-beforeDestroy')
            this.properties=[]
            this.model = {}
            this.$refs.modal = null
        },
        methods:{
            clearF(){
                this.$refs.modal.clearF()
                
            },
            showModal(){
                this.$refs.modal.showModal()
            },
            changeF(data){
                this.model[data.field] = data.value
                //console.log('this.model',this.model)
            },
        }
    }
</script>

<style scoped>

</style>